package cn.mdmm.weixin;

import org.junit.Test;

import cn.mdmm.base.PostClient;
import cn.mdmm.base.URLCOMMON;

public class WxTest {
	
	/**
	 * <p>微信关注</p>
	 */
	@Test
	public void subscribe(){
		StringBuffer xml = new StringBuffer();
//		xml.append("<xml><ToUserName><![CDATA[gh_56cf56200a69]]></ToUserName><FromUserName><![CDATA[o-ot9xIj9DhC50IaMjDV7ssFN1u4]]></FromUserName><CreateTime>1496808413</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[subscribe]]></Event><EventKey><![CDATA[qrscene_1027359103]]></EventKey><Ticket><![CDATA[gQFG8DwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAySzBTT0lPV2JkWjQxYUI5VHhwMUsAAgSVezdZAwQQDgAA]]></Ticket></xml>");
		xml.append("<xml><ToUserName><![CDATA[gh_56cf56200a69]]></ToUserName><FromUserName><![CDATA[o-ot9xIj9DhC50IaMjDV7ssFN1u4]]></FromUserName><CreateTime>1496808413</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[subscribe]]></Event></xml>");
		try {
			String resStr =PostClient.doPost(URLCOMMON.DEVELOP_URL_WX, xml.toString(), "xml");
			System.out.println(resStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
